<?php


require_once 'conn.php';

$username = $_POST['username'];
$sex = $_POST['sex'];
$message = $_POST['message'];
$imgurl = $_POST['imgurl'];

$sql = "INSERT INTO  `bbs`.`t_message` (
`id` ,
`username` ,
`sex` ,
`content` ,
`avater` ,
`time_at`
)
VALUES (
NULL ,  '$username ',  '$sex',  '$message',  '$imgurl',  ''
)";

$result = $conn->query($sql);
//header("location:index.php");
if($result===false){
    echo"数据库操作失败";
}else{
  header("location:index2.php");  
}             